<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div class="box1">添加</div>
    <div class="box2">移除</div>
    <div class="box3">触发</div>
    <script src="../lib.js"></script>
    <script>
        function $(selector) {
            return document.querySelector(selector);
        }
        function test() {
            console.log("sdsds");
        }
        $(".box1").onclick = () => {
            PSEvent.listen("t", test);
        }
        $(".box2").onclick = () => {
            PSEvent.remove("t", test);
        }
        $(".box3").onclick = () => {
            PSEvent.trigger("t", test);
        }
    </script>
</body>
</html>